<extend name="Public:base" />
<!-- 网站标题 -->
<block name="title">数据字典</block>
<block name="appendheader">
	<!-- 选中当前菜单引入 -->
	<script type="text/javascript">
		$(function() {
			$("#WebMenu-1000").addClass('active');	//选中父菜单
			$("#WebMenu-1001").addClass('active');	//选中当前菜单
		});
	</script>
	<!-- 联动引入 -->
	<script type="text/javascript" language="JavaScript">
		function getColumn() {
			$.post("__APP__?g=Admin&m=FieldDict&a=getColumn",{table_name:$("#table_name").val()},function(data) {
				$("#field_name").empty();
				if(data.status == "1") {
					var oResults = data.data;
					for (var i = 0, len = oResults.length; i < len; i++) {
								$("<option value='"+oResults[i].name+"'>"+oResults[i].name+"</option>").appendTo("#field_name");
						}
				} else {
					alert(data.info);
				}
			}, 'json');
		}
	</script>
</block>
<!-- 当前位置 -->
<block name="breadcrumb">
	<div class="page-header pull-left">
		<div class="page-title">数据字典</div>
	</div>
	<ol class="breadcrumb page-breadcrumb pull-left">
		<li><i class="fa fa-home"></i>&nbsp;<a href="__APP__?g=Admin">首页</a>&nbsp;&nbsp;<i class="fa fa-angle-right"></i>&nbsp;&nbsp;</li>
		<li><a href="#">系统设置</a>&nbsp;&nbsp;<i class="fa fa-angle-right"></i>&nbsp;&nbsp;</li>
		<li class="active">数据字典</li>
	</ol>
</block>
<!-- 网页主内容区 -->
<block name="main_content">
	<div class="row">
		<div class="col-md-12">
			<div class="portlet box">
				<div class="portlet-body">
					<div class="row mbm">
						<div class="col-md-12" style="padding-left:5px;">
							<form name="myform" id="myform" action="__APP__?g=Admin&m=FieldDict&a=index" method="post" enctype="multipart/form-data" >
								<div class="tb-group-actions pull-left">
									<select name="table_name" id="table_name" onChange="getColumn();" class="table-group-action-select form-control input-inline input-small input-sm mlm">
										<option value="0">请选择表名</option>
										<volist name="table_list" id="vo">
											<option <eq name="Think.request.table_name" value="$vo.name" >selected</eq> value="{$vo.name}">{$vo.name}</option>
										</volist>
									</select>
									<select name="field_name" id="field_name" onchange="myform.submit();" class="table-group-action-select form-control input-inline input-small input-sm mlm">
										<option value="0">请选择字段</option>
										<volist name="field_list" id="vo">
											<option <eq name="Think.request.field_name" value="$vo.name" >selected</eq> value="{$vo.name}">{$vo.name}</option>
										</volist>
									</select>
									&nbsp;
									<button type="submit" class="btn btn-sm btn-primary submit-action"><i class="fa fa-check"></i>&nbsp;查询 </button>
								</div>
							</form>
							&nbsp;
							<a href="__APP__?g=Admin&m=FieldDict&a=add&table_name={$Think.request.table_name}&field_name={$Think.request.field_name}" class="btn btn-sm btn-success"><i class="fa fa-plus"></i>&nbsp;添加</a>
						</div>
					</div>
					<table class="table table-hover table-striped table-bordered table-advanced tablesorter">
						<thead>
							<tr>
								<th>数据表名称</th>
								<th>字段名称</th>
								<th>字段值</th>
								<th>字段含义</th>
								<th width="120">字段类型</th>
								<th>备注</th>
								<th width="100">操作员</th>
								<th width="120">操作日期</th>
								<th width="150">管理操作</th>
							</tr>
						</thead>
						<tbody>
							<volist name="list" id="vo">
								<tr>
									<td>{$vo.table_name}</td>
									<td>{$vo.field_name}</td>
									<td>{$vo.field_value}</td>
									<td>{$vo.field_mean}</td>
									<td>{$vo.type_name}</td>
									<td>{$vo.remark}</td>
									<td>{$vo.operator}</td>
									<td>{$vo.update_date}</td>
									<td>
										<a type="button" href="__APP__?g=Admin&m=FieldDict&a=edit&table_name={$vo.table_name}&field_name={$vo.field_name}&field_value={$vo.field_value}" class="btn btn-blue btn-xs mbs"><i class="fa fa-edit"></i>&nbsp;编辑 </a>&nbsp;
										<a type="button" onclick="return confirm('你确定删除吗？')" href="__APP__?g=Admin&m=FieldDict&a=delete&table_name={$vo.table_name}&field_name={$vo.field_name}&field_value={$vo.field_value}" class="btn btn-danger btn-xs mbs"><i class="fa fa-trash-o"></i>&nbsp;删除 </a>
									</td>
								</tr>
							</volist>
						</tbody>
					</table>
					{$show}
				</div>
			</div>
		</div>
	</div>
</block>